@extends('admin.layout')

@section('content')

<body>
<div class="panel admin-panel">
    <div class="panel-head"><strong><span class="icon-pencil-square-o"></span> 网站信息</strong></div>
    <div class="body-content">
        <form method="post" class="form-x" action="javascript:;">
        <input type="hidden" id="id" class="input" name="title"  value="{{ $sys['id'] }}" />
        <div class="form-group">
                <div class="label">
                    <label>网站标题：</label>
                </div>
                <div class="field">
                    <input type="text" id="title" class="input" name="title"  value="{{ $sys['title'] }}" />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>网站关键字：</label>
                </div>
                <div class="field">
                    <textarea id="keywords" class="input" name="keywords" style="height:80px" >{{ $sys['keywords'] }}</textarea>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>网站描述：</label>
                </div>
                <div class="field">
                    <textarea id="desc" class="input" name="desc" >{{ $sys['desc'] }}</textarea>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>QQ：</label>
                </div>
                <div class="field">
                    <input id="qq" type="text" class="input" name="qq" value="{{ $sys['qq'] }}" />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>作者：</label>
                </div>
                <div class="field">
                    <textarea id="author" class="input" name="author" style="height:120px;" >{{ $sys['author'] }}</textarea>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>底部信息：</label>
                </div>
                <div class="field">
                    <textarea id="footer" class="input" name="footer" style="height:120px;" >{{ $sys['footer'] }}</textarea>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label></label>
                </div>
                <div class="field">
                    <button id="sub" class="button bg-main icon-check-square-o" type="submit"> 保存</button>
                </div>
            </div>
        </form>
    </div>
</div>
</body>

<script>
//jQuery保存
$('#sub').click(function() {
    //获取修改信息
    var title = $('#title').val(),
        id = $('#id').val(),
        keywords = $('#keywords').val(),
        desc = $('#desc').val(),
        qq = $('#qq').val(),
        author = $('#author').val(),
        footer = $('#footer').val();
    //csrf
    var _token = "{{ csrf_token() }}";

    $.post("{{ url('admin/system/update') }}",{title:title,keywords:keywords,desc:desc,qq:qq,author:author,footer:footer,_token:_token,id:id},function(res){

        if (res.status == 'success') {
            window.parent.location.href="{{ url('admin/index') }}";
        } else {
            layer.msg( res.msg,{icon:2} );
        }
    });
});
</script>

@endsection